home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_surfacelightning.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  76 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # NUB_surfaceLightning.cog
  5. #
  6. # [TL] [RD]
  7. #
  8. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        timer
  13. message        startup
  14.  
  15. thing        origin0                                                # Lightning targets.            
  16. thing        target0
  17. thing        player                                        local
  18.  
  19. material    lightningmat0=aet_4sfx_lightning_v2_a.mat    local    # Mats for the lightning.
  20. material    lightningmat1=aet_4sfx_lightning_v2_b.mat    local
  21. material    lightningmat2=aet_4sfx_lightning_v2_c.mat    local
  22. material    lightningmat3=aet_4sfx_lightning_v2_d.mat    local
  23. material    lightningmat4=aet_4sfx_lightning_v2_e.mat    local
  24.  
  25. sound        strike0=aet_lightning_01.wav                local
  26. sound        strike1=aet_lightning_02.wav                local
  27. sound        strike2=aet_lightning_03.wav                local
  28. sound        strike3=aet_lightning_04.wav                local
  29.  
  30. int            toggle                                        local
  31. int            cnt                                            local
  32. int            randnum                                        local
  33. int            damagesec                                    local
  34.  
  35. end
  36.  
  37. # ========================================================================================
  38. code
  39.  
  40. startup:
  41.  
  42. player = GetLocalPlayerThing();
  43. SetTimer(1.0);
  44.  
  45. return;
  46.  
  47. # ........................................................................................
  48. timer:
  49.  
  50. # Lightning code.
  51. if (toggle == 0)
  52.     {
  53.     for (cnt = 2; cnt <= RandBetween(2, 5); cnt = cnt + 1)
  54.         {
  55.         CreatePolylineThing(origin0, target0, '0 0 0', lightningmat0[RandBetween(0, 4)], 0.05, 0.05, 0.05);
  56.         randnum = RandBetween(0, 3);
  57.         PlaySoundThing(strike0[randnum], target0, 0.2, -1, -1, 0);
  58.         Sleep(0.05);
  59.         }
  60.     }
  61. if (toggle == 1)
  62.     {
  63.     CreatePolylineThing(origin0, player, '0 0 0', lightningmat0[RandBetween(0, 4)], 0.05, 0.05, 0.05);
  64.     randnum = RandBetween(0, 3);
  65.     PlaySoundThing(strike0[randnum], target0, 0.2, -1, -1, 0);
  66.     DamageThing(player, 100, 0x1, damagesec);
  67.     }
  68.  
  69. SetTimer(Rand() * 3.5);
  70.  
  71. return;
  72.  
  73. # ........................................................................................
  74. end
  75.